package net.guerlab.sdk.anubis.accesstoken;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * AccessToken
 * 
 * @author guer
 *
 */
public class AccessTokenDTO {

    /**
     * access_token
     */
    @JsonProperty("access_token")
    private String accessToken;

    /**
     * 超时时间
     */
    @JsonProperty("expire_time")
    private Long expireTime;

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((accessToken == null) ? 0 : accessToken.hashCode());
        return result;
    }

    @Override
    public boolean equals(
            Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof AccessTokenDTO)) {
            return false;
        }
        AccessTokenDTO other = (AccessTokenDTO) obj;
        if (accessToken == null) {
            if (other.accessToken != null) {
                return false;
            }
        } else if (!accessToken.equals(other.accessToken)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("AccessTokenDTO [accessToken=");
        builder.append(accessToken);
        builder.append(", expireTime=");
        builder.append(expireTime);
        builder.append("]");
        return builder.toString();
    }

    /**
     * 返回 accessToken
     *
     * @return accessToken
     */
    public final String getAccessToken() {
        return accessToken;
    }

    /**
     * 设置accessToken
     *
     * @param accessToken
     *            accessToken
     */
    public final void setAccessToken(
            String accessToken) {
        this.accessToken = accessToken;
    }

    /**
     * 返回 超时时间
     *
     * @return 超时时间
     */
    public final Long getExpireTime() {
        return expireTime;
    }

    /**
     * 设置超时时间
     *
     * @param expireTime
     *            超时时间
     */
    public final void setExpireTime(
            Long expireTime) {
        this.expireTime = expireTime;
    }
}
